package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_user_bank", schema = "", catalog = "onedollar")
public class TUserBankEntity {
    private int id;
    private String bankname;
    private String banknumber;
    private String username;
    private String cardtype;
    private String cardnumber;
    private String phone;
    private Integer userId;
    private Timestamp createtime;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "bankname", nullable = true, insertable = true, updatable = true, length = 25)
    public String getBankname() {
        return bankname;
    }

    public void setBankname(String bankname) {
        this.bankname = bankname;
    }

    @Basic
    @Column(name = "banknumber", nullable = true, insertable = true, updatable = true, length = 25)
    public String getBanknumber() {
        return banknumber;
    }

    public void setBanknumber(String banknumber) {
        this.banknumber = banknumber;
    }

    @Basic
    @Column(name = "username", nullable = true, insertable = true, updatable = true, length = 10)
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "cardtype", nullable = true, insertable = true, updatable = true, length = 10)
    public String getCardtype() {
        return cardtype;
    }

    public void setCardtype(String cardtype) {
        this.cardtype = cardtype;
    }

    @Basic
    @Column(name = "cardnumber", nullable = true, insertable = true, updatable = true, length = 25)
    public String getCardnumber() {
        return cardnumber;
    }

    public void setCardnumber(String cardnumber) {
        this.cardnumber = cardnumber;
    }

    @Basic
    @Column(name = "phone", nullable = true, insertable = true, updatable = true, length = 20)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "user_id", nullable = true, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "createtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TUserBankEntity entity = (TUserBankEntity) o;

        if (id != entity.id) return false;
        if (bankname != null ? !bankname.equals(entity.bankname) : entity.bankname != null) return false;
        if (banknumber != null ? !banknumber.equals(entity.banknumber) : entity.banknumber != null) return false;
        if (username != null ? !username.equals(entity.username) : entity.username != null) return false;
        if (cardtype != null ? !cardtype.equals(entity.cardtype) : entity.cardtype != null) return false;
        if (cardnumber != null ? !cardnumber.equals(entity.cardnumber) : entity.cardnumber != null) return false;
        if (phone != null ? !phone.equals(entity.phone) : entity.phone != null) return false;
        if (userId != null ? !userId.equals(entity.userId) : entity.userId != null) return false;
        if (createtime != null ? !createtime.equals(entity.createtime) : entity.createtime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (bankname != null ? bankname.hashCode() : 0);
        result = 31 * result + (banknumber != null ? banknumber.hashCode() : 0);
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (cardtype != null ? cardtype.hashCode() : 0);
        result = 31 * result + (cardnumber != null ? cardnumber.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        return result;
    }
}
